<template>
  <div class="app">
    <h2> Vue路由测试 </h2>
    <!-- 导航区 -->
     <div class="navigate">
      <RouterLink to="/home" active-class="active">首页</RouterLink>
      <RouterLink to="/news" active-class="active">新闻</RouterLink>
      <RouterLink :to="{path:'/about'}" active-class="active">关于</RouterLink>
     </div>
    <!-- 展示区 -->
     <div class="main-content">
       <RouterView></RouterView>
     </div>
  </div>

</template>

<script lang="ts" setup name="App">
import { RouterView } from 'vue-router';

</script>

<style scoped> 
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.app {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 20px;
}

h2 {
  text-align: center;
  color: white;
  margin-bottom: 40px;
  font-size: 3em;
  font-weight: 300;
  text-shadow: 0 4px 8px rgba(0,0,0,0.3);
  letter-spacing: 2px;
}

.navigate {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.navigate a {
  color: white;
  text-decoration: none;
  padding: 15px 30px;
  border-radius: 15px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  font-size: 1.1em;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.navigate a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.navigate a:hover::before {
  left: 100%;
}

.navigate a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.navigate a.active {
  background: rgba(255, 255, 255, 0.25);
  color: #2c3e50;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.main-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  min-height: 500px;
  position: relative;
  overflow: hidden;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .app {
    padding: 15px;
  }
  
  h2 {
    font-size: 2em;
    margin-bottom: 30px;
  }
  
  .navigate {
    flex-direction: column;
    align-items: center;
    padding: 15px;
  }
  
  .navigate a {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
  }
  
  .main-content {
    padding: 20px;
    min-height: 400px;
  }
}

@media (max-width: 480px) {
  h2 {
    font-size: 1.5em;
  }
  
  .navigate a {
    padding: 12px 20px;
    font-size: 1em;
  }
  
  .main-content {
    padding: 15px;
  }
}
</style>